import Vue from 'vue'
import Router from 'vue-router'

import login from '../components/login'
import frame from '../components/frame'
import order from '../components/order'
// import activities from '../components/activities'
import news from '../components/news'
import customer from '../components/customer'
import basicInfo from '../components/basicInfo'


import checkActivity from '../components/activity/checkActivity'

import checkEmail from '../components/email/checkEmail'
import emailDetail from '../components/email/emailDetail'
import sendEmail from '../components/email/sendEmail'

import operateAccount from '../components/account/operateAccount'
import handleAccount from '../components/account/handleAccount'
import welcome from '../components/welcome.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/index',
      name: 'index',
      component: frame,
      children:[
        {
          path: 'order',
          name: 'order',
          component: order,
        },
        
        {
          path: 'news',
          name: 'news',
          component: news,
        },

        {
          path: 'activity/checkActivity',
          name: 'checkActivity',
          component: checkActivity,
        },



        {
          path: 'email/checkEmail',
          name: 'checkEmail',
          component: checkEmail,
        },
        {
          path: 'email/emailDetail',
          name: 'emailDetail',
          component: emailDetail,
        },
        {
          path: 'email/sendEmail',
          name: 'sendEmail',
          component: sendEmail,
        },
        {
          path: 'email/*',
          redirect:{name:'checkEmail'}
        },

        {
          path: 'account/operate',
          name: 'operateAccount',
          component: operateAccount,
        },
        {
          path: 'account/handle',
          name: 'handleAccount',
          component: handleAccount,
        },
        {
          path: 'account/*',
          redirect:{name:'operateAccount'}
        },


        {
          path: 'customer',
          name: 'customer',
          component: customer,
        },
        {
          path: 'basicInfo',
          name: 'basicInfo',
          component: basicInfo,
        },
        {
          path:'',
          name:welcome,
          component:welcome,
        }
      ]
    },   
    {
      path: '/',
      name: 'other',
      component: login
    },
  ]
})
